# Contributor: Jordi De Groof <jordi dot degroof at gmail dot com>
# Contributor: Andre Klitzing <aklitzing () gmail () com>
# Contributor: Simon Sobisch <simonsobisch () gnu () org>

pkgname=lcov
pkgver=1.15
pkgrel=1
pkgdesc="front-end for GCC's coverage testing tool gcov"
arch=('any')
url="https://ltp.sourceforge.io/coverage/lcov.php"
license=('GPL')
depends=('perl'
         'perl-JSON'
         'perl-PerlIO-gzip')
source=("https://github.com/linux-test-project/lcov/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.gz"
        "001-mingw-lcov1.12-handle-equals-signs.patch"
        "002-mingw-lcov1.12-fix-undef-behaviour.patch")
sha256sums=('c1cda2fa33bec9aa2c2c73c87226cfe97de0831887176b45ee523c5e30f8053a'
            '54728aa4e244d3662c65ba91fb486dc1d5c64d9d55745ee334c4131109dc233c'
            'ceaf41f7cc9cea5a6fc4b0385ffef10d1ab8812acd2a5b16dcd8d7bca7120488')

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  patch -p1 -i ${srcdir}/001-mingw-lcov1.12-handle-equals-signs.patch
  patch -p1 -i ${srcdir}/002-mingw-lcov1.12-fix-undef-behaviour.patch
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  make PREFIX="/usr" DESTDIR="${pkgdir}" install
}
